/*
 * @Authoryour name
 * @Date2021-01-02 22:47:56
 * @LastEditTime2021-01-02 22:47:56
 * @LastEditorsyour name
 * @DescriptionIn User Settings Edit
 * @FilePath\ART-Pi_STM32H750_Bootloader\Bsp\bsp_key\bsp_key.h
 */ 
#ifndef BSP_KEY_H_
#define BSP_KEY_H_

#include "common_types.h"
#include "stm32h7xx.h"

#define KEY_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOH_CLK_ENABLE()
#define KEY_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOH_CLK_DISABLE()
#define KEY_USER_GPIO_PIN            GPIO_PIN_4    
#define KEY_USER_GPIO_PORT           GPIOH


typedef enum key_index
{
    KEY_IDX_USER = 0,
    KEY_IDX_NUM,
}key_index_t;

typedef enum key_state
{
    KEY_STA_PRESSED = 0,
    KEY_STA_RELEASED,
    KEY_STA_NUM,
}key_state_t;

extern void bsp_key_init(void);
extern void bsp_key_deinit(void);
extern key_state_t bsp_key_get_status(key_index_t index);

#endif

